#include <STC89C5xRC.H>
#include "delay.h"
#include "LCD1602.H"
#include "timer0.h"
#include "Int0.h"
#include "IR.h"



unsigned char num=0;
unsigned char address;
unsigned char command;

void main()
{
	LCD_Init();
	LCD_ShowString(1,1,"ADDR  CMD  NUM");
	LCD_ShowString(2,1,"00    00   000");
	
	ir_init();

	while(1)
	{
		if(ir_getdataflag() || ir_getrepeatflag())
		{
			address=ir_getaddress();
			command=ir_getcommand();
			
			LCD_ShowHexNum(2,1,address,2);
			LCD_ShowHexNum(2,7,command,2);
			
			
			if(command==ir_VOL_MINUS)
			{
				num--;
			}
			if(command==ir_VOL_ADD)
			{
				num++;
			}
			
			LCD_ShowNum(2,12,num,3);
		
		
		
		
		
		
		}
	}

}

